<template>
  <div class="son-component-body">
    我是第{{message.id}}个子组件
    <ul>
      <li>我的名字是{{message.uname}}</li>
      <li>我的姓是{{message.famliyName}}</li>
      <li>我的年龄是{{message.age}}</li>
      <li>我的职业是{{message.profess}}</li>
      <li><button @click = "NewHappyYear">过了一年</button></li>
    </ul>
  </div>
</template>
 
<script>
export default {
  name: 'SonComponent',
  props:['message'],
  data() {
    return {}
  },

  methods: {
    NewHappyYear() {
      this.$emit('NewYear', this.message.id, 1)
    }
  }
}
</script>

<style scoped>
.son-component-body {
  width: 200px;
  height: 150px;
  background-color: pink;
  border: 3px solid #333;
  margin: 10px 20px;
}
</style>